package com.sharing.common;

import lombok.Data;

import java.io.Serializable;

/**
 * @author MingTian
 * @version 1.0
 * @description TODO
 * @date 2023/4/1 22:53
 */
@Data
public class Result<T> implements Serializable {
    /**
     * 结果集状态：0 ——> 正常  1 ——> 异常
     */
    private int state;

    /**
     * 结果集数据
     */
    private T data;

    /**
     * 异常信息：若结果集状态为 1 ，请填写该字段
     */
    private String message;

    public Result() {
    }

    public Result(int state, T data) {
        this.state = state;
        this.data = data;
    }

    public Result(int state, String message) {
        this.state = state;
        this.message = message;
    }

    public Result(int state, T data, String message) {
        this.state = state;
        this.data = data;
        this.message = message;
    }
}
